#ifndef aux_0b058ffc154ce3bc6fa7bc1ad262c8ae
#define aux_0b058ffc154ce3bc6fa7bc1ad262c8ae

#include "stdint.h"

#define BIT_TEST(val,bit) (val & ( 1 << bit) )

#define BYTE3(x) (( ((uint32_t)(x)) & 0xFF000000 ) >> 24)
#define BYTE2(x) (( ((uint32_t)(x)) & 0x00FF0000 ) >> 16)
#define BYTE1(x) (( ((uint32_t)(x)) & 0x0000FF00 ) >>  8)
#define BYTE0(x) (( ((uint32_t)(x)) & 0x000000FF ) >>  0)

inline uint32_t bytes_4_to_uint32( uint8_t d, uint8_t c, uint8_t b, uint8_t a) {
    return ((uint32_t)(d<<24)) | ((uint32_t)(c<<16)) | ((uint32_t)(b<<8)) | ((uint32_t)(a));
}

#define error(x) { cout << "error: " << x << endl; flush(cout); exit(-1); }
#define  warn(x) { cout << "warn:  " << x << endl; flush(cout);  }

#endif

